function rule_load(selecter){
	window.location ="/iptables/rule/show/load/"+selecter[0].options[selecter[0].selectedIndex].value+"/";
	
	/*
	for(var i=0;i<selecter[0].options.length;i++)
				if (selecter.options[i].selected == true )
					window.location ="/iptables/rule/show/load/"+selecter[0].options[selecter[0].selectedIndex].value+"/";
*/
}

function rule_kategori(selecter){
	if (selecter[0].selectedIndex==0){
		
		window.location ="/iptables/rule/show/sort/"+selecter[0].options[selecter[0].selectedIndex].value+"/";
	}
	else if(selecter[0].selectedIndex==1){
		window.location = "/iptables/rule/show/sort/"+selecter[0].options[selecter[0].selectedIndex].value+"/";
	}
	else if(selecter[0].selectedIndex==2){
		window.location ="/iptables/rule/show/sort/"+selecter[0].options[selecter[0].selectedIndex].value+"/";
	}
}

function port_degisti(selecter,inputer){
	if (selecter[0].selectedIndex==0){
		inputer[0].value="0";
		inputer[0].readOnly=true;
	}
	else if(selecter[0].selectedIndex==1){

		if (inputer[0].readOnly==true){
			inputer[0].readOnly=false;
		}
		inputer[0].value="8000-9000";
	}

	else if(selecter[0].selectedIndex==2){
		if (inputer[0].readOnly==true){
			inputer[0].readOnly=false;
		}
		inputer[0].value="80";
	}

	else if(selecter[0].selectedIndex==3){
		
		if (inputer[0].readOnly==true){
			inputer[0].readOnly=false;
		}
		inputer[0].value="21,80";
	}

}
/*Degisti fonksyonu ip cesidine gore bir deger atar input'a*/ 
function ip_degisti(selecter,inputer){
	
	if (selecter[0].selectedIndex==0){
		inputer[0].value="0.0.0.0/0";
		inputer[0].readOnly=true;
	}
	else if(selecter[0].selectedIndex==1){

		if (inputer[0].readOnly==true){
			inputer[0].readOnly=false;
		}
		inputer[0].value="0.0.0.0-0.0.0.1";
	}

	else if(selecter[0].selectedIndex==2){
		if (inputer[0].readOnly==true){
			inputer[0].readOnly=false;
		}
		inputer[0].value="10.0.0.0";
	}

	else if(selecter[0].selectedIndex==3){
		
		if (inputer[0].readOnly==true){
			inputer[0].readOnly=false;
		}
		inputer[0].value="10.0.0.0/8";
	}
}

/*In some cases some of the fields shouldnt be choosable*/
function dev_disable(zin,kdev,hdev){
	kdev[0].disabled=false;
	hdev[0].disabled=false;

	var ops=zin[0].options[zin[0].selectedIndex].text;

	if (ops=="OUTPUT"){
		kdev[0].selectedIndex=0;
		kdev[0].disabled=true;
	}

	if (ops=="INPUT"){
		hdev[0].selectedIndex=0;
		hdev[0].disabled=true;
	}


}
